﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MagicBag.CRM.MiddleModel.EasyUI
{
    /// <summary>
    /// EasyUI菜单树实体
    /// 主要用于生成与EasyUI树对应格式的json数据
    /// </summary>
    public class MenuTreeNode
    {
        public MenuTreeNode() { }

        public MenuTreeNode(int id, string text)
        {
            this.id = id;
            this.text = text;
        }
        public int id
        {
            get;
            set;
        }

        public string text
        {
            get;
            set;
        }

        public string state
        {
            get
            {
                return (children != null && children.Count > 0) ? "closed" : "open";//默认如果有了节点就closed，否则open
            }
        }

        public MenuTreeAttributes attributes
        {
            get;
            set;
        }

        public IList<MenuTreeNode> children
        {
            get;
            set;
        }
    }
}
